home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 003 / dbaseacc.arc / TIMECALC.PRG < prev    next >
Encoding:
Text File  |  1979-12-31  |  3.1 KB  |  128 lines

  1.      **********  TIMECALC COMMAND FILE **********
  2. * Verifies that employee name and number match, then
  3. * calculates billing charges for employee time.
  4. *********************************************************
  5.  
  6. SET TALK OFF
  7. ERASE
  8. SELECT PRIMARY
  9. RESTORE FROM Constant
  10.  
  11. GO TOP
  12. DO WHILE .NOT. EOF
  13.    ERASE
  14.    @  4,20 SAY '     ** DO NOT INTERRUPT **      '
  15.    @  5,20 SAY '     PROCESSING TIME CHARGES     '
  16.  
  17.    IF * .OR. Job:Nmbr = 31 .OR. Check:Nmbr <> '---'
  18.       SKIP
  19.    ELSE
  20.       REPLACE Client WITH !(Client),Name WITH !(Name)
  21.       STORE STR(#,4) TO Number
  22.       @  7,20 SAY '         Record # '+Number
  23.       @  8,20 SAY '         '+Name
  24.       ? CHR(7)
  25.       IF Emp:Nmbr<=0 .OR. Emp:Nmbr>MaxEmpl .OR. Hours = 0
  26.   ERASE
  27.   REPLACE Hours WITH Hours*1.00
  28.   REPLACE Emp:Nmbr WITH Emp:Nmbr*1
  29.    @ 4,0 SAY ' '
  30.   DISPLAY
  31.   @ 6,3 SAY 'HOURS='
  32.   @ 6,18 SAY '=EMPLOYEE NUMBER'
  33.   ?
  34.   ? 'Press ANY KEY to correct the EMPLOYEE NUMBER,'
  35.   ? 'or press H to correct the HOURS.'
  36.   WAIT TO Decision
  37.   IF !(Decision) <> 'H'
  38.      @ 6,14 GET Emp:Nmbr
  39.   ELSE
  40.         @ 6,8 GET Hours
  41.   ENDIF
  42.   READ
  43.       ELSE
  44.          SELECT SECONDARY
  45.   USE Personne
  46.   STORE T TO Looking
  47.   DO WHILE Looking .AND. .NOT. EOF
  48.      IF $(Name,1,10)=$(P.Name,1,10)
  49.         IF Emp:Nmbr+P.Emp:Nmbr
  50.         SELECT PRIMARY
  51.           * Formula optimistically assumes 65 billable hours out
  52.         * of 75 hours possible in two weeks.  Eff. mult.=3.23
  53.         REPLACE Amount WITH Pay:Rate*2.8*Hours/65
  54.         SELECT SECONDARY
  55.         STORE F TO Looking
  56.             ELSE
  57.          SELECT PRIMARY
  58.         STORE T TO Fixing
  59.         DO WHILE Fixing
  60.     ERASE
  61.     @ 4,0 SAY ' '
  62.     DISPLAY
  63.     @ 6,16 SAY '=EMPLOYEE NUMBER'
  64.     ?
  65.  
  66.            ? 'The correct Employee Number is'
  67.     ?? S.Emp:Nmbr
  68.     ?? ' for '+S.Name
  69.     ? 'Press ANY KEY to change the EMPLOYEE NUMBER'
  70.     ? 'press N to change the NAME.'
  71.     WAIT TO Choice
  72.     IF !(Choice) <> 'N'
  73.        @ 6,12 GET Emp:Nmbr
  74.        READ
  75.        STORE F TO Fixing
  76.     ELSE
  77.       @ 5,25 GET Name
  78.    REPLACE Name WITH !(Name)
  79.    READ
  80.    STORE F TO Fixing
  81.     ENDIF Employee number
  82.     ERASE
  83.         ENDDO Fixing
  84.         SELECT SECONDARY
  85.         GO TOP
  86.      ENDIF Numbers match
  87.          ELSE
  88.       SKIP
  89.          ENDIF
  90.  
  91.   IF EOF
  92.      ERASE
  93.      SELECT PRIMARY
  94.      @ 4,0 SAY ' '
  95.      DISPLAY
  96.      @ 6,16 SAY '=EMPLOYEE NUMBER'
  97.      ?
  98.      ? 'This name is not listed in the Personnel file,'
  99.      ? 'so time charges were not calculated.'
  100.      ? 'Press any key to change the name, or write the'
  101.      ? 'record number down and press D to DELETE.'
  102.      WAIT TO Change
  103.      IF !(Change)<> 'D'
  104.         @ 5,25 GET Name
  105.         REPLACE Name WITH !(Name)
  106.         READ
  107.         SKIP-1
  108.      ELSE
  109.         ERASE
  110.         DELETE
  111.         DISPLAY
  112.         ?
  113.         ? 'THIS RECORD HAS BEEN DELETED.'
  114.         WAIT
  115.             ENDIF Change
  116.      SELECT SECONDARY
  117.    ENDIF no name
  118.       ENDDO Looking
  119.       SELECT PRIMARY
  120.       SKIP
  121.    ENDIF
  122. ENDIF deleted
  123. ENDDO billing calculations
  124.  
  125. RELEASE All
  126. RETURN
  127.  
  128.